<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<title>经视帮帮网 - 后台管理中心</title>
<link href="__Public__/Admin/css/reset.css" rel="stylesheet" type="text/css" />
<link href="__Public__/Admin/css/zh-cn-system.css" rel="stylesheet" type="text/css" />
<link href="__Public__/Admin/css/table_form.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="__Public__/Admin/js/jquery.min.js"></script>
</head>
<body>
<div class="subnav">
    <div class="content-menu ib-a blue line-x">
        <a href='/Admin/index.php/Expand/Authority' ><em>权限管理</em></a><span>|</span>    </div>
</div>
<style type="text/css">
	html{_overflow-y:scroll}
</style>

<script type="text/javascript">
$(document).ready(function(){
	$('#del').click(function () {
		var name = $('#name').val();
		if(!name){
			alert('无效查询！');
			return false;
		}
		$.ajax({
			   type: "POST",
			   url: "/Admin/index.php/Expand/Authorityscys",
			   data: "name="+name,
			   success: function(msg){
				    $('#users').html(msg);
				    $('#useradd').css('display','inline');
			   }
		});
	});
	
	$('#useradd').click(function () {
		var u_id = $('#u_id').val();
		if(!u_id){
			alert('无效查询！');
			return false;
		}
		$.ajax({
			   type: "POST",
			   url: "/Admin/index.php/Expand/Authorityscyadd/id/{$roleid}",
			   data: "u_id="+u_id,
			   success: function(msg){
				   if(msg==2){
					   alert('重复添加!');
					   return false;
				   }
					if(msg!=0){
						alert('添加成功!');
						$("#tbody").append(msg);
					}else{
						alert('失败！');
					}
			   }
		});
	});
	
});
</script>
<div class="pad_10">
<div class="common-form">

<input type="hidden" name="roleid" value="4"></input>
<table width="100%" class="table_form contentWrap">
<tr>
<td>添加用户</td>
<td>
<input type="text" name="name" value="{$name}" class="input-text" id="name"> <a href="#" id="del">查询</a>  <span id="users"></span>  <a id="useradd" style="display: none;">添加</a>	(输入用户名)
</td>
<tbody id="tbody">
</tr>
<volist name="user" id="vur">
		<tr>
		<td>{$vur.u_id}</td>
		<td>{$vur.name}</td>
		</tr>
</volist>
</tbody>
</table>
</div>
</body>
</html>

